c + d + e + f = p

 
Numbers to 20
Row and column totals are red
Diagonal total is green